﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using System;
using System.Xml;

namespace XGame
{
   public static class GameHelper
    {


       
       /// <summary>
       /// This function is used for turning the PlayerIndex object into an Integer
       /// </summary>
       /// <param name="Index">The player index you would like to be converted to an integer</param>
       /// <returns> The integer representation of a player index</returns>
       public static int indexToInt(PlayerIndex Index)
       {
           switch (Index)
           {
               case PlayerIndex.One:
                   return 1;
                   //break;
               case PlayerIndex.Two:
                   return 2;
                  // break;
               case PlayerIndex.Three:
                   return 3;
                  // break;
               case PlayerIndex.Four:
                   return 4;
                  // break;


           }
           throw( new IndexOutOfRangeException());
       }

       /// <summary>
       /// Generates a Random number within a specified range
       /// </summary>
       /// <param name="max">The maximum value of the random number to be generated</param>
       /// <param name="min">The minimum value of the random number to be generated</param>
       /// <returns> a random number between the specified values</returns>
       public static int GetRandomInt(int max, int min)
       {
           Random ranGen = new Random();
           return ranGen.Next(min, max);
       }

       /// <summary>
       /// Generates a Random number 
       /// </summary>
       /// <returns>A random value</returns>
       public static int GetRandomInt()
       {
           Random ranGen = new Random();
           return ranGen.Next();
       }
    }
}
